# 二进制转十进制
a = input(":")
l = []
for i in a:
    l.append(i)

i = len(l)-1
u = 0
for e in l:
    u = u+int(e)*(2**i)
    i = i-1

print(u)

# 十进制转二进制
s = ""
a = input(":")
a = int(a)

while 1:
    s += f"{a % 2}"
    a = int(a/2)
    if a == 0:
        break

s = s[::-1]
print(s)

# 方法2
a = 10
b = bin(a)   # 将整数转换为二进制字符串
print(b)
print(type(b))

